<div class="bjui-pageHeader" style="background-color:#fefefe; border-bottom:none;">
    <form data-toggle="ajaxsearch"
          data-options="{url:'/admin/personnel/train/plan-list',searchDatagrid:$.CurrentNavtab.find('#train-plan-list')}">
        <fieldset>
            <legend style="font-weight:normal;">搜索：</legend>
            <div style="margin:0; padding:1px 5px 5px;">
                <span>开始时间：</span>
                <input type="text" name="start_time" class="form-control" data-toggle="datepicker" readonly>
                <span>结束时间：</span>
                <input type="text" name="end_time" class="form-control" data-toggle="datepicker" readonly>
                <button type="submit" class="btn-green" data-icon="search">开始搜索！</button>
                <button type="reset" class="btn-orange" data-icon="times">重置</button>
            </div>
        </fieldset>
    </form>
</div>
<div class="bjui-pageContent">
    <table id="train-plan-list" class="table table-bordered" data-toggle="datagrid" data-options="{
        height: '100%',
        dataUrl: '/admin/personnel/train/plan-list',
        {{--delUrl: '/admin/personnel/address-list-member-del',--}}
        delPK: 'employee_id',
        paging: {showPagenum:10, selectPageSize:'20,50,100', pageCurrent:1, pageSize:20},
        {{--paging: false,--}}
        fullGrid: true,
        linenumberAll: true,
        filterThead:false,
        fieldSortable:false,
        columnMenu:false,
        showToolbar: true,
        toolbarCustom: toolbar,
        isTree:'name',
        treeOptions:{
            keys: {
                {{--key: 'id',        // id--}}
                parentKey: 'oa_department_id',       // 父id
                childKey: 'contacts_list',  // 子列表数据key值
                {{--childLen  : 'childlen',  // 子列表数据条数--}}
                {{--isParent  : 'isparent',  // 是否父数据--}}
                {{--level     : 'level',     // 层级--}}
                {{--order     : 'order',     // 顺序--}}
                isExpand: 'isExpand'   // 子列表是否展开
            },
            expandAll: false,
            {{--simpleData: true,          // 是否简单数据(array格式)--}}
            add: false           // 显示添加按钮
        }
    }">
        <thead>
        <tr>
            <th data-options="{name:'name',align:'center',width:100}">名称</th>
            {{--<th data-options="{name:'mobile',align:'center',width:100}">行业</th>--}}
            <th data-options="{name:'money',align:'center',width:100}">培训费用</th>
            <th data-options="{name:'start_time',align:'center',width:100}">报名时间</th>
            <th data-options="{name:'end_time',align:'center',width:100}">结束时间</th>
            {{--<th data-options="{name:'created_at',align:'center',width:100}">发布时间</th>--}}
            <th data-options="{name:'display',align:'center',width:100,render:displayColumn}">是否显示</th>
            <th data-options="{align:'center',width:100,render:operationColumn}">操作</th>
        </tr>
        </thead>
    </table>
</div>

<script type="text/javascript">
    function displayColumn(value,data){
        return value == 1 ? '<button>是</button>':'<button>否</button>';;
    }
    function operationColumn(value, data) {
        var html = '<button type="button" class="btn btn-green" data-toggle="navtab" data-options="{id:\'plan-edit\', url:\'/admin/personnel/train/plan-edit\', title:\'培训计划编辑\',data:{id:' + data.id + '}}"><i class="fa fa-edit"></i>编辑</button>'
        return html;
    }
    function toolbar() {
        return '<button type="button" class="btn btn-blue"  data-toggle="navtab" data-options="{id:\'plan-add\', url:\'/admin/personnel/train/plan-add\', title:\'添加培训计划\', fresh:true}"><i class="fa fa-plus"></i> 添加</button>';
    }
</script>